package zhihui.mobile.ui.utils;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

import zhihui.mobile.config.Config;

/**
 * Created by 张公铭 on 2017/8/23 0023.
 */

public class SharedPreferenceUtils
{
    public static boolean getConState(Context context)
    {
        SharedPreferences sharedPreferences = context.getSharedPreferences(Config.CONF_STATE_NAME, Activity.MODE_PRIVATE);
        boolean isInit = sharedPreferences.getBoolean(Config.CONF_SATE_KEY, true);
        return isInit;
    }

    public static void setConSatet(Context context, boolean state)
    {
        SharedPreferences sharedPreferences = context.getSharedPreferences(Config.CONF_STATE_NAME, Activity.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putBoolean(Config.CONF_SATE_KEY, false);
    }
}
